'''
Created on 2012-10-8

@author: infear
'''
import fileinput,re

field_pat=re.compile(pattern=r'\[(.+?)\]', flags=0)
field_pat_py=re.compile(pattern=r'(.+)(\.py)')

scope={}

def replace(match):
    code=match.group(1)
    if field_pat_py.match(code):
        execfile(code)
        return None
    try:
        return str(eval(code,scope))
    except SyntaxError:
        exec code in scope
        return None

lines=[]
for line in fileinput.input():
    lines.append(line)
text=''.join(lines)

print field_pat.sub(replace,text)